<template>
  <div style="height: 100%">
    <!-- <hear></hear> -->
    <div>
      <div class="Guarantee_status_box">
        <el-row  class="mb8">
            <el-col :span="19">
                <el-button type="info" @click="shuaxin" icon="el-icon-refresh-right"></el-button>
                <!-- <el-button type="success" @click="handleAdd" icon="el-icon-plus">上传</el-button> -->
            </el-col>
            <el-col :span="5" class="seach">
               <el-input v-model="params.keywords" placeholder="请输入文件名称"></el-input>
                <el-button type="primary" icon="el-icon-search" @click="shuaxin"></el-button>
            </el-col>
        </el-row>

        <div class="shenflex">
          <el-table
            ref="multipleTable"
            :data="tableData"
            tooltip-effect="dark"
            height="250"
            class="table"
            @selection-change="handleSelectionChange"
          >
            <el-table-column
              align="center"
              prop="applyNumber"
               :show-overflow-tooltip="true"
              label="保函编号"
                  width="280"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="biddingName"
              :show-overflow-tooltip="true"
              label="项目名称"
              width="120"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="biddingNumber"
              :show-overflow-tooltip="true"
              label="标段编号"
              width="120"
            >
            </el-table-column>
       
            <el-table-column
              label="创建时间"
              align="center"
              width="200"
              prop="createTime"
            >
              <!-- <template slot-scope="scope">
               {{scope.row.createTime | dateFormat}}
              </template> -->
            </el-table-column>
            <el-table-column
              align="center"
              prop="marginAmount"
              :show-overflow-tooltip="true"
              label="保费金额"
              width="120"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="gtype"
              :show-overflow-tooltip="true"
              label="保函类型"
              width="120"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="guaranteeCompanyName"
              :show-overflow-tooltip="true"
              label="担保机构名称"
              width="120"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="applyCompanyName"
              :show-overflow-tooltip="true"
              label="申请公司名称"
              width="120"
            >
            </el-table-column>
            <el-table-column
              align="center"
              prop="state"
              label="支付状态"
              width="120"
            >
              <!-- 发票类型代码(004-专票 007-普票 026-电子票)  -->
              <template slot-scope="scope">{{
                scope.row.state == "0"
                  ? "等待支付"
                  : scope.row.state == "1"
                  ? "支付中"
                  : "支付成功"
              }}</template>
            </el-table-column>
            <el-table-column
              align="center"
              prop="state"
              label="担保状态"
              width="120"
            >
              <!-- 发票类型代码(004-专票 007-普票 026-电子票)  -->
              <template slot-scope="scope">{{
                  scope.row.guarantee == "0"
                  ? "申请中"
                  :   scope.row.guarantee == "1"
                  ? "审核中"
                  :   scope.row.guarantee == "2"
                  ? "审核通过"
                  : "审核不通过"
              }}</template>
            </el-table-column>
              <el-table-column   prop="scope"   :show-overflow-tooltip="true"
              width="120" fixed="right" align="center" label="操作">
              <template slot-scope="scope">
                <el-button type="text" @click="handlesc(scope.row)" size="small">查看详情</el-button>
              </template>
            </el-table-column>
          </el-table>
        </div>
      </div>

      <div class="block">
        <el-pagination
          background
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :page-size="params.limit"
          :current-page="params.offset"
          :page-sizes="[10, 20, 30]"
          layout="total, sizes, prev, pager, next, jumper"
          :total="limit"
        ></el-pagination>
      </div>
    </div>
  </div>
</template>

<script>
import { bhlist } from "@/api/system/liucheng";
import { bhsh_list, guoqi } from "@/api/system/liucheng";
// import hear from ".././../components/hear.vue";
import axios from "axios";
export default {
  components: {
    // hear
  },
  name: "progress",
  data() {
    return {
      total: null,
      currentpage: null,
      // params: {
      //   limit: 4,
      //   offset: 0,
      //   keywords: "",
      //   user_id: sessionStorage.getItem("user_id"),
      // },
      BidingDocumentList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      opens: false,
      params: {
        offset: 1,
        limit: 10,
        keywords: "",
      },
      total: null,
      limit: 0,
      // 表单参数
      // 表单校验
      rules: {},
      options1: [], //选择部门
      options2: [], //选择职位
      btype: [],
      options3: [], //选择小组
      options4: [], //选择小组
      currentPage1: 5,
      currentPage2: 5,
      currentPage3: 5,
      currentPage4: 4,
      tableData: [],
      multipleSelection: [],
      liuch: {
        user_id: sessionStorage.getItem("id"),
        lc_name: "",
        gtype: "",
      },
      buzhl: false,
      buzhilist: [],
    };
  },
  mounted() {
    // this.getBhlist();
    this.zhifu();
  },
  methods: {
    handleUpdate(e) {
      // this.reset();
      this.opens = true;
      //   this.title = "修改员工信息";
    },
    handlesc(e) {
       this.$router.push({name:'bhxq',query:{company_id:e.guaranteeApplyId}});
     },
    buzhlist(e) {
      this.buzhl = true;
    },
    zhifu() {
      guoqi(this.params).then((res) => {
        // console.log("发票列表", res.data.data.total);
        this.limit = res.data.data.total;
        this.tableData = res.data.data.data;
        console.log(this.tableData);
      });
    },
    shuaxin() {
      this.zhifu();
    },
    getBhlist() {
      bhlist(this.params).then((res) => {
        this.BidingDocumentList = res.data.data.rows;
        this.total = res.data.data.total;
      });
    },
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
      this.params.limit = val;
      this.zhifu();
    },
    handleCurrentChange(val) {
      this.params.offset = val;
      this.currentpage = val;
      this.zhifu();
    },
  },
};
</script>
<style >
.shenflex {
  padding-bottom: 0px !important;
}
</style>
<style scoped >
/* .table{
        height: 76vh;
    margin-top: 10px;
 
} */
html body {
  height: 100% !important;
  /* background-color: #f5f6fa !important; */
}
.block {
  padding: 10px;
  width: 100%;
  display: flex;
  justify-content: flex-end;
}
.state_bh {
  font-size: 18px;
  font-family: Microsoft YaHei-Regular, Microsoft YaHei;
  font-weight: 400;
  color: #1890ff;
  width: 143px;
  height: 47px;
  border-radius: 4px 4px 4px 4px;
  opacity: 1;
  line-height: 47px;
  text-align: center;
  border: 2px solid #1890ff;
}
.shenflex {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* padding: 20px; */
    padding-top: 0px;
  padding-bottom: 0px;
      height: 62.3vh;
  margin-top: 10px;
  overflow: auto;
}
.status_bg1 {
  width: 85px;
  height: 40px;
  background-color: #ff1818;
  border-bottom-left-radius: 10px;
  position: relative;
  bottom: 87%;
  left: 94%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  font-size: 18px;
}

.status_bg {
  width: 85px;
  height: 40px;
  background-color: #1795ff;
  border-bottom-left-radius: 10px;
  position: relative;
  bottom: 87%;
  left: 94%;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  font-size: 18px;
}

.examine_btn {
  width: 143px;
  height: 47px;
  color: #1795ff;
}

.bubble {
  color: #ffffff;
  font-size: 12px;
  width: 94px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 31px;
  margin-left: 20px;
  background-image: url("@/assets/Guarantee/Bubble.png");
}

.Guarantee_details {
  justify-content: space-around;
}

.Ge_box {
  width: 113px;
  height: 33px;
  border-radius: 4px;
  background-color: #1795ff;
  display: flex;
  justify-content: center;
  align-items: center;
  color: #ffffff;
  margin-left: 15px;
}

.Guarantee_num {
  width: 219px;
  height: 48px;
  color: #333333;
}

.Guarantee_status_box {
  /* position: relative;
  top: 9%;
  left: 247px; */
}

.Guarantee_status {
  width: 95%;
  height: 162px;
  margin-bottom: 20px;
  background-color: #ffffff;
  box-shadow: 0px 0px 6px 1px rgba(0, 0, 0, 0.16);
}

.Guarantee_examine {
  color: #333333;
  font-size: 24px;
  margin-left: 30px;
  margin-top: 10px;
  font-weight: Bold;
  margin-bottom: 36px;
}

::v-deep .el-table__body-wrapper {
  /* height: 69vh !important; */
  /* margin-top: 10px; */
  overflow: auto !important;
}
</style>
<style scoped>
</style>
